import Taro, { useState } from "@tarojs/taro";
import styles from "./count.module.less";

const Counter = ({ initialCount }) => {
  console.log("styles: ", styles);
  const [count, setCount] = useState(initialCount);
  return (
    <View>
      Count: {count}
      <Button className={styles.reset} onClick={() => setCount(initialCount)}>
        Reset
      </Button>
      <Button onClick={() => setCount((prevCount) => prevCount + 1)}>+</Button>
      <Button onClick={() => setCount((prevCount) => prevCount - 1)}>-</Button>
      <View className={styles.test}>
        <Text className={styles.txt}>Hello world!</Text>
      </View>
    </View>
  );
};

export default Counter;
